//
//  LoginViewController.swift
//  quizDemo
//
//  Created by LiuXing on 2017/9/10.
//  Copyright © 2017年 quiz. All rights reserved.
//

import UIKit

class LoginViewController: UIViewController {
    
    var isLogin: Bool = true

    @IBOutlet weak var loginButton: UIButton!
    @IBAction func loginBottonclick(_ sender: Any) {
        if isLogin {
            let alertView = UIAlertView.init(title: "", message: "Login in Success", delegate: self, cancelButtonTitle: "confirm")
            alertView.show()
        } else {
            let alertView = UIAlertView.init(title: "", message: "Register in Success", delegate: self, cancelButtonTitle: "confirm")
            alertView.show()
        }

    }
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        if !isLogin {
            loginButton.setTitle("Register", for: .normal)
        }
    }

}

extension LoginViewController: UIAlertViewDelegate {
    func alertView(_ alertView: UIAlertView, clickedButtonAt buttonIndex: Int) {
        navigationController?.popViewController(animated: true)
    }
}
